﻿using System.Web.UI;

namespace TTQT.Administration
{
    using System;
    using System.Data;
    using System.Drawing;
    using System.Web;
    using System.Web.UI.WebControls;
    using System.Web.UI.HtmlControls;

    /// <summary>
    ///		Summary description for Welcome.
    /// </summary>
    public partial class Welcome : MasterControl//System.Web.UI.UserControl
    {
        private void layDuLieuChoMoiCongViecVaHienNhungDongCoViec()
        {
            DataTable t = TTQT_Code.TTQTCommon.GetSoLuongAnChi(UserInfo.MaKho, UserInfo.userName);

            if (null != t)
            {
                if (t.Rows.Count > 0)
                {
                    int datHang = 0;
                    int phanHoi = 0;

                    datHang = TTQT_Code.TTQTCommon.ToInt32(t.Rows[0]["datHang"], 0);
                    phanHoi = TTQT_Code.TTQTCommon.ToInt32(t.Rows[0]["phanHoi"], 0);

                    lblDatHang.Text = datHang.ToString();
                    lblPhanHoi.Text = phanHoi.ToString();
                    if(datHang>0)
                    {
                        trDatHang.Visible = true;
                    }
                    if(phanHoi>0)
                    {
                        trPhanHoi.Visible = true;
                    }
                }
            }
        }
        private void hideAllRows()
        {
            trDatHang.Visible = false;
            trPhanHoi.Visible = false;
        }
        protected void Page_Load(object sender, System.EventArgs e)
        {

            hideAllRows();
            layDuLieuChoMoiCongViecVaHienNhungDongCoViec();
            if (trDatHang.Visible||trPhanHoi.Visible)
            {
                pnChao.Visible = false;
                pnCongViec.Visible = true;
            }
            else
            {
                pnChao.Visible = true;
                pnCongViec.Visible = false;
            }
        }

        #region Web Form Designer generated code
        override protected void OnInit(EventArgs e)
        {
            //
            // CODEGEN: This call is required by the ASP.NET Web Form Designer.
            //
            InitializeComponent();
            base.OnInit(e);
        }

        /// <summary>
        ///		Required method for Designer support - do not modify
        ///		the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
        }
        #endregion
    }
}
